#include "gtkheaderbarprivate.h"
#include "gtkicontheme.h"
#include "gtkintl.h"
-#include "gtkkeyhash.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtkmessagedialog.h"
static gboolean gtk_window_activate_menubar (GtkWidget *widget,
GVariant *args,
gpointer unused);
-static GtkKeyHash *gtk_window_get_key_hash (GtkWindow *window);
-static void gtk_window_free_key_hash (GtkWindow *window);
#ifdef GDK_WINDOWING_X11
static void gtk_window_on_theme_variant_changed (GtkSettings *settings,
GParamSpec *pspec,
static gchar *default_icon_name = NULL;
static gboolean disable_startup_notification = FALSE;
-static GQuark quark_gtk_window_key_hash = 0;
static GQuark quark_gtk_window_icon_info = 0;
static GtkBuildableIface *parent_buildable_iface;
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
- quark_gtk_window_key_hash = g_quark_from_static_string ("gtk-window-key-hash");
quark_gtk_window_icon_info = g_quark_from_static_string ("gtk-window-icon-info");
if (toplevel_list == NULL)
if (priv->group)
gtk_window_group_remove_window (priv->group, window);
- gtk_window_free_key_hash (window);
-
GTK_WIDGET_CLASS (gtk_window_parent_class)->destroy (widget);
}
if (priv->transient_parent && gtk_widget_get_display (GTK_WIDGET (priv->transient_parent)) != display)
gtk_window_set_transient_for (window, NULL);
- gtk_window_free_key_hash (window);
#ifdef GDK_WINDOWING_X11
g_signal_handlers_disconnect_by_func (gtk_settings_get_for_display (priv->display),
gtk_window_on_theme_variant_changed, window);
static void
gtk_window_keys_changed (GtkWindow *window)
{
- gtk_window_free_key_hash (window);
- gtk_window_get_key_hash (window);
-}
-
-typedef struct _GtkWindowKeyEntry GtkWindowKeyEntry;
-
-struct _GtkWindowKeyEntry
-{
- guint keyval;
- guint modifiers;
-};
-
-static void
-window_key_entry_destroy (gpointer data)
-{
- g_slice_free (GtkWindowKeyEntry, data);
-}
-
-static GtkKeyHash *
-gtk_window_get_key_hash (GtkWindow *window)
-{
- GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
- GtkKeyHash *key_hash = g_object_get_qdata (G_OBJECT (window), quark_gtk_window_key_hash);
-
- if (key_hash)
- return key_hash;
-
- key_hash = _gtk_key_hash_new (gdk_display_get_keymap (priv->display),
- (GDestroyNotify)window_key_entry_destroy);
- g_object_set_qdata (G_OBJECT (window), quark_gtk_window_key_hash, key_hash);
-
- return key_hash;
-}
-
-static void
-gtk_window_free_key_hash (GtkWindow *window)
-{
- GtkKeyHash *key_hash = g_object_get_qdata (G_OBJECT (window), quark_gtk_window_key_hash);
- if (key_hash)
- {
- _gtk_key_hash_free (key_hash);
- g_object_set_qdata (G_OBJECT (window), quark_gtk_window_key_hash, NULL);
- }
}
/*